﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

/// <summary>
/// Temp For Create Object
/// </summary>
public class EffectItemManager : MonoBehaviour
{
	[SerializeField]
	public List<GameObject> pf_ItemBase;

	[SerializeField]
	protected Random.State Cur_Seed;
	[SerializeField]
	protected float Duration = 0.2f;

	public void Awake()
	{
		Cur_Seed = Random.state;	 
	}

	float curTime = 0;
	int cout = 5;
	private void Update()
	{
		curTime += Time.deltaTime;
		if(curTime >= Duration)
		{
			GameObject go =Instantiate(pf_ItemBase[0],this.transform);
			go.transform.localPosition = GetRandomPosition(new Vector2(2400, 2400));
			go.name = cout++.ToString();
			curTime = 0;
		}
	}


	Vector3 GetRandomPosition(Vector2 size) => new Vector3(
		Random.Range(-size.x, size.x), Random.Range(-size.y, size.y),0
		);
}
